import {createApp} from 'vue'
import App from './App.vue'
import store from './store'

import 'element-plus/dist/index.css'

import router from './router'

import './utils/dateFormat'

// 检查是否已登录,未登录则重定向到登录页
const currentUser = localStorage.getItem('currentUser');
if (!currentUser && window.location.pathname !== '/login') {
    window.location.href = '/login';
}

const app = createApp(App)
app.use(store)
app.use(router)
app.mount('#app')
